package com.cpd.blog.common.constant;

/**
 * 状态码
 * 首位表示模块 次位表示对应状态的执行结果
 *
 * @author Copydown
 * @date 2022/04/30 01:53
 */

public enum StatusCode {

    SUCCESS(200, "成功"),
    SYSTEM_ERROR(-999, "系统异常"),
    VALIDATED_ERROR(-998, "参数校验不合法"),

    PARAMS_NULL(11000, "参数为空"),
    PARAMS_ERROR(10001, "参数有误"),
    TOKEN_ERROR(11002, "TOKEN不合法"),
    TOKEN_NULL(11003, "TOKEN为空"),
    NOT_PERMISSION(11004, "无访问权限"),
    SESSION_TIME_OUT(11005, "会话超时"),
    VERIFY_CODE_WRONG(11006, "验证码不正确"),
    VERIFY_CODE_FREQUENT(11007, "验证码发送太频繁"),
    VERIFY_CODE_EXPIRE(11008, "未发送或验证码已过期"),

    ACCOUNT_NO_EXIST(21000, "账号不存在"),
    ACCOUNT_EXIST(21001, "账号已存在"),

    USER_LOGOUT_SUCCESS(30002, "退出登陆成功"),
    USER_CHANGE_NICKNAME_SUCCESS(30003, "修改昵称成功"),
    USER_CHANGE_PASSWORD_SUCCESS(30004, "修改密码成功"),
    USER_NOT_ALLOW_OPTION(31000, "不允许用户操作"),
    USER_NOT_LOGIN(31001, "用户未登录或登陆已过期"),
    USER_LOGOUT_FAILED(31002, "退出登陆失败"),
    USER_NOT_HAVE_DATA(31003, "不是归属于用户的数据"),
    USER_PASSWORD_WRONG(31004, "用户密码错误"),
    USER_LOGIN_FAILED(31005, "用户登陆失败"),
    USER_NICKNAME_EXIST(31006, "用户昵称已存在"),
    USER_CHANGE_NICKNAME_FAILED(31007, "修改昵称失败"),
    USER_PASSWORD_SAME(31008, "用户密码与之前相同"),
    USER_CHANGE_PASSWORD_FAILED(31009, "修改密码失败"),

    ARTICLE_NOT_EXISTED(40000, "文章不存在"),
    ARTICLE_SINGLE_DELETE_SUCCESS(40001, "单独删除文章成功"),
    ARTICLE_BODY_DELETE_SUCCESS(40002, "文章主体删除成功"),
    ARTICLE_TAG_DELETE_SUCCESS(40003, "文章标签删除成功"),
    ARTICLE_RELATE_DELETE_SUCCESS(40004, "文章相关内容删除成功"),
    ARTICLE_DELETE_SUCCESS(40005, "文章删除成功"),
    ARTICLE_SINGLE_DELETE_FAILED(41001, "单独删除文章失败"),
    ARTICLE_BODY_DELETE_FAILED(41002, "文章主体删除失败"),
    ARTICLE_TAG_DELETE_FAILED(41003, "文章标签删除失败"),
    ARTICLE_RELATE_DELETE_FAILED(41004, "文章相关内容删除失败"),
    ARTICLE_DELETE_FAILED(41005, "文章删除失败"),
    ARTICLE_ID_NULL(41006, "文章id为空"),

    COMMENT_DELETE_SUCCESS(50000, "文章评论删除成功"),
    COMMENT_DELETE_FAILED(51000, "文章评论删除失败"),

    IMAGE_UPLOAD_FAILED(61000, "图片上传失败"),
    EMAIL_SEND_FAILED(61001, "邮件发送失败");

    private int code;
    private String msg;

    StatusCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
